-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rename Menu components #2996
base: next
Are you sure you want to change the base?
rename Menu components #2996
Conversation
68f98e9
to
e5be58b
Compare
2774972
to
e31290c
Compare
e31290c
to
2461d1d
Compare
export { MainNavigationCollapsibleItem, MainNavigationCollapsibleItemProps } from "./mui/mainNavigation/CollapsibleItem"; | ||
export { MainNavigationCollapsibleItemClassKey } from "./mui/mainNavigation/CollapsibleItem.styles"; | ||
export { MainNavigationContext, MainNavigationContextValue, WithMainNavigation, withMainNavigation } from "./mui/mainNavigation/Context"; | ||
export { MainNavigationItem, MainNavigationItemProps } from "./mui/mainNavigation/Item"; | ||
export { MainNavigationItemClassKey } from "./mui/mainNavigation/Item.styles"; | ||
export { MainNavigationItemAnchorLink, MainNavigationItemAnchorLinkProps } from "./mui/mainNavigation/ItemAnchorLink"; | ||
export { MainNavigationItemGroup, MainNavigationItemGroupClassKey, MainNavigationItemGroupProps } from "./mui/mainNavigation/ItemGroup"; | ||
export { MainNavigationItemRouterLink, MainNavigationItemRouterLinkProps } from "./mui/mainNavigation/ItemRouterLink"; | ||
export { MainNavigation, MainNavigationProps } from "./mui/mainNavigation/MainNavigation"; | ||
export { MainNavigationClassKey } from "./mui/mainNavigation/MainNavigation.styles"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now maybe a good time to ask whether we actually need all these exports. For instance, none of our projects use withMenu. @jamesricky what do you think?
import { IMenuContext } from "./Context"; | ||
import { MenuItem as CometMenuItem, MenuItemLevel } from "./Item"; | ||
import { MainNavigationContextValue } from "./Context"; | ||
import { MainNavigationItem as CometMainNavigationItem, MainNavigationItemLevel } from "./Item"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It shouldn't be necessary to have import alias inside the same package IMO.
@@ -0,0 +1,28 @@ | |||
import { ComponentType, createContext, Dispatch, FunctionComponent, SetStateAction } from "react"; | |||
|
|||
export interface MainNavigationContextValue { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TypeScript supports both a type and a variable with the same name, so we don't need the Value suffix.
@@ -201,18 +201,18 @@ export { useStoredState } from "./hooks/useStoredState"; | |||
export { InputWithPopper, InputWithPopperComponents, InputWithPopperProps } from "./inputWithPopper/InputWithPopper"; | |||
export { InputWithPopperClassKey } from "./inputWithPopper/InputWithPopper.slots"; | |||
export { messages } from "./messages"; | |||
export { MainNavigationCollapsibleItem, MainNavigationCollapsibleItemProps } from "./mui/mainNavigation/CollapsibleItem"; | |||
export { MainNavigationCollapsibleItemClassKey } from "./mui/mainNavigation/CollapsibleItem.styles"; | |||
export { MainNavigationContext, MainNavigationContextValue, WithMainNavigation, withMainNavigation } from "./mui/mainNavigation/Context"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest to not export the context and create a useMainNavigation()
or useMainNavigationApi()
hook instead.
Now we have the terms main navigation and master menu for related, but different things. Might this confuse devs? @jamesricky what do you think? |
Description
Rename all Menu components to better differentiate between comet and mui components:
Acceptance criteria
Open TODOs/questions
Further information